#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include <QDialog>
#include <QGridLayout>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include "verifycodewidget.h"
#include "model/datacenter.h"

class LoginWidget : public QWidget
{
    Q_OBJECT
public:
    LoginWidget(QWidget* parent = nullptr);

    void clickSubmitBtn();

    //区分提交网络请求后, 登录是否成功
    void userLoginDone(bool ok, const QString& reason);

    //区分提交网络请求后, 注册是否成功
    void userRegisterDone(bool ok, const QString& reason);

private:


    //是否为登陆窗口
    bool isLoginMode;

    //切换登陆/注册窗口
    void switchMode();

    //切换到电话登陆窗口
    void switchToPhone();

    //控件相关
    QLabel* tipLabel;
    QLineEdit* usernameEdit;
    QLineEdit* passwordEdit;
    QLineEdit* verifyCodeEdit;
    VerifyCodeWidget* verifyCodeWidget;
    QPushButton* submitBtn;
    QPushButton* phoneModeBtn;
    QPushButton* switchModeBtn;



signals:
};

#endif // LOGINWIDGET_H
